#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

red=$(tput setaf 1)
green=$(tput setaf 2)
reset=$(tput sgr0)

if ! npm run --no -- commitlint --edit $1 ; then
    echo "${red}请按规范填写commit描述后重新提交！${reset}"
    printf "\n"
    exit 1;
fi

echo "${green}提交成功 ${reset}"
printf "\n"
exit
